<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Cookie主域 和子域之间的差别</title>
</head>
<body>

	<form action="cookie?action=add" method="post">
		domain:<input type="text" name="domain" value="${requestScope.domain}" /> <br />
		name:<input type="text" name="cookieName" value="${requestScope.cookieName}" /> <br />
		value:<input type="text" name="cookieValue" value="${requestScope.cookieValue}" /> <br /> <input
			type="submit" value="add" /> <br />


	</form>
	<hr />
	<form action="cookie?action=remove" method="post">
		domain:<input type="text" name="domain" value="${requestScope.domain}" /> <br />
		name:<input type="text" name="cookieName" value="${requestScope.cookieName}" /> <br /> <input
			type="submit" value="remove" 　 />
	</form>

	<form action="cookie?action=get" method="post">
		<input type="submit" value="get" />
	</form>
	<div>
		<%
			Cookie[] cookies = request.getCookies();
		if(cookies!=null)
		{
			for (Cookie c : cookies) {
		%>
		<div>
			name:<%=c.getName()%>
			value:<%=c.getValue()%>
			domain:<%=c.getDomain()%></div>
		<%
			}
		}
		%>
	</div>
</body>
</html>